<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value=" ${pageContext.request.contextPath}" />
<html>
<head>
<title>整改有效性评价统计</title>
<script src="${ctx}/static/selectWin/orgSelector.js?version=${applicationScope.jsVersion }" type="text/javascript"></script>
<script src="${ctx}/static/selectWin/employeeSelector.js?version=${applicationScope.jsVersion }" type="text/javascript"></script>
<script type="text/javascript">
	var $grid, $detailGrid, selectTableRow;//选中的行数据
	var editIndex = -1;
	var grid;
	$(function() {
		$grid = $("#grid").datagrid(
				$.extend({}, datagridOption, {
					//url : "${ctx}/hr//dataGridStatistic",
					frozenColumns : [ [] ],
					columns : [ [
							{
								field : 'childDept',
								title : '部门名称',
								sortable : false,
								width : 180
							},{
								field : 'wqzg',
								title : '完全整改',
								sortable : false,
								width : 100
							} ,{
								field : 'bfzgwxjxzg',
								title : '部分整改无需继续整改',
								sortable : false,
								width : 100
							}  ,{
								field : 'wxuzg',
								title : '无需整改',
								sortable : false,
								width : 100
							} ,{
								field : 'bfzgrxjxzg',
								title : '部分整改仍需继续整改',
								sortable : false,
								width : 100
							} ,{
								field : 'zzzg',
								title : '正在整改',
								sortable : false,
								width : 100
							},{
								field : 'wxizg',
								title : '无效整改',
								sortable : false,
								width : 100
							},{
								field : 'nzgwzg',
								title : '能整改未整改',
								sortable : false,
								width : 100
							},{
								field : 'count',
								title : '合计',
								sortable : false,
								width : 100
							} ] ],
					onDblClickRow : function(index, rowData) {
						$.isFunction(fn_edit) && fn_edit.call(this, rowData);
					},
					fitColumns:true
				}));

		fn_initComboNotId("type", "type", false);
		//查询日期初始化
		var jsonArray = new Array;
        var date=new Date();
        var year=date.getFullYear();
        for (i=year-5;i<year+1;i++){
            jsonArray.push({"value":i,"text":i});
        }
        $("#startYear,#endYear").combobox({
		    valueField:'value',
		    textField:'text',
		    data:jsonArray,
		    editable : false,
			width : 177
		});

        $("#startYear,#endYear").combobox("select",year);
		
		 setTimeout(function(){
			 //$("#search").click();
		 },100)


		$("#search").click(function() {
			var startYear=$("#startYear").datebox("getValue");
			var endYear=$("#endYear").datebox("getValue");
			var type=$("#type").combobox("getValues");

			$("#grid").datagrid("reload","${ctx}/fnd/auditPro/recEffectStatistic?startYear="+startYear+"&endYear="+endYear+"&type="+type);
		});
		$("#excelExport").click(function() {
			var url = "${ctx}/fnd/auditPro/recEffectStatisticExcelExport";
			var startYear=$("#startYear").datebox("getValue");
			var endYear=$("#endYear").datebox("getValue");
			var type=$("#type").combobox("getValues");

			url=url+"?startYear="+startYear+"&endYear="+endYear+"&type="+type;
			
			window.parent.location.href = url;
		});
		
		
		 
	});


		
</script>
</head>

<body>
	<div data-options="region:'center',fit:true,border:false">
		<table id="grid">
		</table>
	</div>
	<div id="tt" class="row">
		<div class="col-md-12">
			<table cellspacing="0" cellpadding="0">
				<tr>
					<td align="right"><span>开始年份：</span>
					<td><input id="startYear" type="text" /></td>
					<td align="right"><span>结束年份：</span>
					<td><input id="endYear" type="text" /></td>
					<td align="right"><span>年份：</span>
					<td colspan="9"><span>类别：</span><input id="type" name="search_EQ_auditPro.type"
						class="easyui-combobox" ></td>
					<td><div class="dialog-tool-separator"></div></td>
					
					<td>
						<button id="search" type="button" class="btn btn-primary">
							<span class="glyphicon glyphicon-search"></span> 统计
						</button>
						<shiro:hasPermission name="auditProDtl:export">
						<button id="excelExport" type="button" class="btn btn-primary">
							<span class="glyphicon glyphicon-save"></span> 导出
						</button>
						</shiro:hasPermission>
					</td>
				</tr>
			</table>
		</div>
	</div>

</body>
</html>
